package com.douqu.game.core.config.activity;

import com.douqu.game.core.entity.GameObject;
import com.douqu.game.core.util.LoadUtils;
import com.douqu.game.core.util.LogUtils;
import com.douqu.game.core.util.time.TimeData;

/**
 * Created by dengbo on 2018/10/19 0019.
 */
public class SevenTabConfig  extends GameObject {

    //活动类型
    public int type;

    public int tab;

    //开始时间
    public TimeData startTime;

    //持续时间
    public TimeData continuedTime;

    //开放等级
    public int openLevel;

    @Override
    public boolean check()
    {
        if (startTime == null){
            LogUtils.error("SevenTabConfig startTime is null id :" + id + " name:" + name);
            return false;
        }
        if (continuedTime == null){
            LogUtils.error("SevenTabConfig continuedTime is null id :" + id + " name:" + name);
            return false;
        }
        return true;
    }

    @Override
    public boolean setVariable(String key, String value) {
        if ("startTime".equals(key)){
            startTime = LoadUtils.loadTimeData(key, value);
            return true;
        }
        else if ("continuedTime".equals(key)){
            continuedTime = LoadUtils.loadTimeData(key, value);
            return true;
        }
        else
        return super.setVariable(key, value);
    }

    @Override
    public String toString() {
        return "SevenTabConfig{" +
                "} " + super.toString();
    }

}
